﻿using AiXiu.DAL;
using AiXiu.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AiXiu.BLL
{
    public class UserBLL
    {
        UserDAL userDAL = new UserDAL();
        #region 查询用户列表数据(UserList页面测试)
        /// <summary>
        /// 获取用户列表数据
        /// </summary>
        /// <returns></returns>
        public List<TBUsers> GetList()
        {
            return userDAL.GetList();
        }
        #endregion
        /// <summary>
        /// 查找用户的具体信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public TBUsers getInfo(int id)
        {
            return userDAL.getUserInfo(id);
        }
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public OperResult<TBUsers> UpdateUserInfo(TBUsers user)
        {
            TBUsers users = userDAL.UpdateUserInfo(user);
            return OperResult<TBUsers>.Succeed(users);  
        }
        /// <summary>
        /// 修改用户头像
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public OperResult<TBUsers> UpdateHeadPortrait(TBUsers user)
        {
            TBUsers users = userDAL.UpdateHeadPortrait(user);
            return OperResult<TBUsers>.Succeed(users);
        }
    }
}
